#pragma once
#include <gl\GLU.h>
#include <limits>

// Color conversion macros
#define RGB_TO_GLINT(X) X*(INT_MAX/256)
#define GET_GLINT_R(X)  RGB_TO_GLINT(GetRValue(X))
#define GET_GLINT_G(X)  RGB_TO_GLINT(GetGValue(X))
#define GET_GLINT_B(X)  RGB_TO_GLINT(GetBValue(X))

class OpenGl_Drawable
{
    public:
        //! Default constructor
        OpenGl_Drawable(void);

        //! Default destructor
        ~OpenGl_Drawable(void);

        //! Enumeration with fonts used in this project
        enum OGL_DRAWABLE_FONT
        {
            OGL_DRAWABLE_FONT_ARIAL_10 = 1000,
            OGL_DRAWABLE_FONT_ARIAL_15 = 2000,
            OGL_DRAWABLE_FONT_LUCIDA_CONSOLE_10 = 3000
        };

        /**
        * @brief Draw some text to the a specified position
        *
        * @param Text             - Text
        * @param FontListBase     - Fontdescriptor
        * @param XPos, YPos       - Position
        * @param Red, Green, Blue - RGB color
        **/
        void drawText(const CStringW& Text,
                      OGL_DRAWABLE_FONT FontListBase,
                      double XPos, double YPos,
                      GLint Red,
                      GLint Green,
                      GLint Blue);

        /**
        * @brief Initialises all fonts
        **/
        void initFonts();

        //! Fonts, initialised at first use
        CFont m_FontArial_10;
        CFont m_FontArial_15;
        CFont m_FontLucidaConsole_10;
};

